#!/bin/make
#

#
# commands
#

RM = del /F /Q
AS = ca65
LD = ld65

#
# Flags
#

ASFLAGS = -t vic20 -g  -I . -I ..\prototype
LDFLAGS =  

#
# Sources
#

8PLAY_SOURCES = eightplay.asm irq.asm prolog.asm main.asm frame.asm sprites.asm game.asm global.asm sound.asm slowride.asm winner.asm
8PLAY_OBJECTS = $(patsubst %.asm,%.o,$(8PLAY_SOURCES))

TARGETS = 8play.prg

#
# targets
#

.PHONY : all clean install

all:	$(TARGETS)

install:

clean:
	$(RM) $(8PLAY_OBJECTS) $(TARGETS) $(patsubst %.bin,%.map,$(TARGETS)) $(patsubst %.bin,%.lbl,$(TARGETS))

8play.prg:	$(8PLAY_OBJECTS)
	$(LD) $(LDFLAGS) -C vic20-8play.cfg -m $(patsubst %.prg,%.map,$@) -Ln $(patsubst %.prg,%.lbl,$@) -o $@ $^
	
#
# Pattern rules
#

.SUFFIXES:
.SUFFIXES: .asm .o

%.o : %.asm
	$(AS) $(ASFLAGS) -o $@ $<
